<template>
	<view class="fudong" @click="toNav(content)">
		<image :src="content.image" mode="widthFix"></image>
	</view>
</template>

<script>
	import {
		apiBaseUrl
	} from '@/config/config.js'
	export default {
		name:"fudong",
		data() {
			return {
				apiBaseUrl,
				content:{}
			};
		},
		methods:{
			
			toNav(item){
				if(item.href.indexOf('http') > -1){
					uni.navigateTo({
						url: `/pages/webview/index?src=${encodeURIComponent(item.href)}`
					})
				}else{
					uni.switchTab({
						url:'/pages/zixun/index'
					})
				}
			},
		},
		created() {
			
			this.$api.article_list_data({
				siteCode: 'main',
				categoryCode: 1001005 
			}, res => {
				if (res.code == 200) {
					this.content = res.data.list[0]
				}
			})
		}
	}
</script>

<style lang="scss">
.fudong{
	position: fixed;
	right: 10rpx;
	bottom: 150rpx;
	z-index: 100;
	
	image{
		width: 160rpx;
	}
}
</style>